package com.bestcem.xm.ticket.enums;

import lombok.Getter;
import lombok.ToString;

/**
 * 工单导出状态枚举
 *
 * @author zq.ding <zq.ding@idiaoyan.com>
 * @version v1.0
 * @date 2021/8/27 19:53
 */
@Getter
@ToString
public enum TicketExportStatusEnum {
    /**
     * CREATED
     */
    CREATED("已创建", 0),
    /**
     * FOLLOWING
     */
    FOLLOWING("处理中", 1),
    /**
     * AUDITING
     */
    AUDITING("无需处理", 2),
    /**
     * MANUAL_CLOSED
     */
    MANUAL_CLOSED("已关闭", 3),
    /**
     * SYSTEM_CLOSED
     */
    SYSTEM_CLOSED("已关闭", 4),
    /**
     * 关闭
     */
    CLOSED("已关闭", 5),
    /**
     * 工单处理完成
     */
    FINISH("处理完成", 6),
    /**
     * 工单处理失败
     */
    FAILED("处理失败", 7),
    /**
     * 无需跟进处理
     */
    UNNEED_DEAL("无需处理", 8),
    /**
     * 删除
     */
    DELETED("已删除", 9);

    private final String name;

    private final Integer index;

    TicketExportStatusEnum(String name, Integer index) {
        this.name = name;
        this.index = index;
    }

    public static TicketExportStatusEnum getByIndex(Integer index) {
        for (TicketExportStatusEnum value : values()) {
            if (value.getIndex().equals(index)) {
                return value;
            }
        }
        return null;
    }
}
